<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Tcl_DumpActiveMemory manual page - Tcl Library Procedures</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tcl C API</a> <small>&gt;</small> DumpActiveMemory</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="DumpActiveMemory.htm#M2" NAME="L238">NAME</A>
<DL><DD>Tcl_DumpActiveMemory, Tcl_InitMemory, Tcl_ValidateAllMemory &mdash; Validated memory allocation interface</DD></DL>
<DD><A HREF="DumpActiveMemory.htm#M3" NAME="L239">SYNOPSIS</A>
<DL>
<DD><B>#include &lt;tcl.h&gt;</B>
<DD>int
<DD><B>Tcl_DumpActiveMemory</B>(<I>fileName</I>)
<DD>void
<DD><B>Tcl_InitMemory</B>(<I>interp</I>)
<DD>void
<DD><B>Tcl_ValidateAllMemory</B>(<I>fileName, line</I>)
<DD>
</DL>
<DD><A HREF="DumpActiveMemory.htm#M4" NAME="L240">ARGUMENTS</A>
<DL class="arguments">
</DL>
<DD><A HREF="DumpActiveMemory.htm#M5" NAME="L241">DESCRIPTION</A>
<DD><A HREF="DumpActiveMemory.htm#M6" NAME="L242">SEE ALSO</A>
<DD><A HREF="DumpActiveMemory.htm#M7" NAME="L243">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
Tcl_DumpActiveMemory, Tcl_InitMemory, Tcl_ValidateAllMemory &mdash; Validated memory allocation interface
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>#include &lt;tcl.h&gt;</B><BR>
int<BR>
<B>Tcl_DumpActiveMemory</B>(<I>fileName</I>)<BR>
void<BR>
<B>Tcl_InitMemory</B>(<I>interp</I>)<BR>
void<BR>
<B>Tcl_ValidateAllMemory</B>(<I>fileName, line</I>)<BR>
<BR>
<H3><A NAME="M4">ARGUMENTS</A></H3>
<DL class="arguments">
<DT><A HREF="../TclLib/Interp.htm">Tcl_Interp</A> <B>*interp</B> (in)<DD>
Tcl interpreter in which to add commands.
<P><DT>const char <B>*fileName</B> (in)<DD>
For <B>Tcl_DumpActiveMemory</B>, name of the file to which memory
information will be written.  For <B>Tcl_ValidateAllMemory</B>, name of
the file from which the call is being made (normally <B>__FILE__</B>).
<P><DT>int <B>line</B> (in)<DD>
Line number at which the call to <B>Tcl_ValidateAllMemory</B> is made
(normally <B>__LINE__</B>).
<P></DL>
<H3><A NAME="M5">DESCRIPTION</A></H3>
These functions provide access to Tcl memory debugging information.
They are only functional when Tcl has been compiled with
<B>TCL_MEM_DEBUG</B> defined at compile-time.  When <B>TCL_MEM_DEBUG</B>
is not defined, these functions are all no-ops.
<P>
<B>Tcl_DumpActiveMemory</B> will output a list of all currently
allocated memory to the specified file.  The information output for
each allocated block of memory is:  starting and ending addresses
(excluding guard zone), size, source file where <B><A HREF="../TclLib/Alloc.htm">ckalloc</A></B> was
called to allocate the block and line number in that file.  It is
especially useful to call <B>Tcl_DumpActiveMemory</B> after the Tcl
interpreter has been deleted.
<P>
<B>Tcl_InitMemory</B> adds the Tcl <B><A HREF="../TclCmd/memory.htm">memory</A></B> command to the
interpreter given by <I>interp</I>.  <B>Tcl_InitMemory</B> is called
by <B><A HREF="../TclLib/Tcl_Main.htm">Tcl_Main</A></B>.
<P>
<B>Tcl_ValidateAllMemory</B> forces a validation of the guard zones of
all currently allocated blocks of memory.  Normally validation of a
block occurs when its freed, unless full validation is enabled, in
which case validation of all blocks occurs when <B><A HREF="../TclLib/Alloc.htm">ckalloc</A></B> and
<B><A HREF="../TclLib/Alloc.htm">ckfree</A></B> are called.  This function forces the validation to occur
at any point.

<H3><A NAME="M6">SEE ALSO</A></H3>
<B>TCL_MEM_DEBUG</B>, <B><A HREF="../TclCmd/memory.htm">memory</A></B>
<H3><A NAME="M7">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#memory">memory</A>, <A href="../Keywords/D.htm#debug">debug</A>
<div class="copy">Copyright &copy; 1992-1999 Karl Lehenbauer &amp; Mark Diekhans.
<BR>Copyright &copy; 2000 Scriptics Corporation.
</div>
</BODY></HTML>
